package com.qf.commons.web.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerAutoConfiguration {

    @Bean
    public OpenAPI springShopOpenAPI() {
        return new OpenAPI()
                .info(new Info().title("优惠券模块接口文档标题")
                .description("接口文档描述")
                //设置作者信息
                .contact(new Contact().name("Ken").email("123@qq.com").url("http://www.baidu.com"))
                .version("v1")
                //设置开源协议版本
                .license(new License().name("Apache 2.0").url("http://springdoc.org")))
                .externalDocs(new ExternalDocumentation()
                        //外部文档描述
                        .description("外部文档")
                        .url("https://springshop.wiki.github.org/docs"));
    }
}
